package team.central.util;

import org.lwjgl.input.Mouse;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Input;
import org.newdawn.slick.state.StateBasedGame;

public class Clickables {

	public void stateChange(int state, int greaterX, int lessX, int greaterY, int lessY, GameContainer gc, StateBasedGame sbg) {
		Input input = gc.getInput();
		int posx = Mouse.getX();
		int posy = Math.abs(Mouse.getY() - sbg.getContainer().getHeight()) - 1;
		
		if ((posx >= greaterX) && (posx <= lessX) && (posy >= greaterY) && (posy <= lessY)) {
			if (input.isMousePressed(0)) {
				sbg.enterState(state);
			}
		}
		
	}
	
	
	
}
